define(() => {
    return function (goods, id, cb) {
        let i = 0;
        goods.some((val, idx) => {
            i = idx;
            return val.id === id;
        })
        cb(i);
        localStorage.setItem("goods", JSON.stringify(goods));
    }
})